Skip to content

Refactor/extract live to monorepo#73

Merged
MarcosBrendonDePaula merged 15 commits intomainfrom
refactor/extract-live-to-monorepo
Mar 14, 2026
Merged

Refactor/extract live to monorepo#73
MarcosBrendonDePaula merged 15 commits intomainfrom
refactor/extract-live-to-monorepo

Conversation

@MarcosBrendonDePaula
Copy link
Copy Markdown
Collaborator

No description provided.

MarcosBrendonDePaula and others added 12 commits March 1, 2026 14:58
Live Components system moved to FluxStackCore/fluxstack-live as
independent packages (@fluxstack/live, @fluxstack/live-client,
@fluxstack/live-express, @fluxstack/live-elysia, @fluxstack/live-react).

Core FluxStack now imports from @fluxstack/live instead of bundling
the live components internally. This decouples the real-time system
from the framework, allowing it to be used with any backend.

Removed from core/:
- server/live/ internal implementations (ComponentRegistry, RoomManager, etc.)
- client/ hooks and components (useLiveComponent, Live, etc.)
- build/vite-plugin-live-strip
- server/live/__tests__/

Updated imports across app/ and plugins/ to use @fluxstack/live.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace vi.mock('@core/server/live/...') with setLiveComponentContext() DI
pattern from @fluxstack/live. Fix EMIT_OVERRIDE_KEY to use Symbol.for()
since the symbol wasn't exported from the npm package runtime. Update
FileUploadManager import path. All 531 tests pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The @fluxstack/live-* aliases in vite.config.ts pointed to the sibling
fluxstack-live monorepo source, which only exists in local development.
In CI, the sibling repo doesn't exist, causing the Vite build to fail
silently. Now the aliases are only applied when the local monorepo is
detected; otherwise Vite resolves from node_modules (published npm
packages).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
… bug

- Update @fluxstack/live-* dependencies from ^0.1.0 to ^0.2.0
- Fix create-fluxstack project name using full path instead of basename
- Bump version to 1.15.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Integrates the new @fluxstack/live typed room system into the FluxStack
demo application with working examples and updated documentation.

## New Demos
- PingPong: Real-time latency measurement with binary msgpack room events,
  auto-ping mode, RTT stats (AVG/MIN/MAX), and visual ping log
- SharedCounter: Singleton counter using typed LiveRoom with
  CounterRoom for cross-client state sync

## Typed Room Definitions
- ChatRoom: Typed room for chat messages with user join/leave events
- CounterRoom: Typed room for shared counter with increment tracking
- DirectoryRoom: Room directory with metadata and member counts
- PingRoom: Ping/pong room for latency measurement demos

## Removed Legacy Demos
- Removed ChatDemo (replaced by RoomChatDemo with typed rooms)
- Removed TodoListDemo (replaced by more relevant demos)
- Removed LiveChat/LiveTodoList server components

## Infrastructure
- Updated websocket-plugin to support LiveRoom binary frame routing
- Updated live-components-generator for room class discovery
- Added Vite aliases for @fluxstack/live source resolution
- Updated LLMD docs: live-rooms.md rewritten for typed rooms,
  added live-binary-delta.md for binary codec documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Removed the LiveDebugger floating widget (1325 lines), full-screen
panel (780 lines), and all related exports. The debug system was
unused and removed from the upstream library.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…0.3.0

CI workflows were using Bun 1.1.34, below the minimum required >=1.2.0,
causing silent backend build failures. Also updates @fluxstack/live,
live-client, and live-react from ^0.2.0 to ^0.3.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Tests were failing due to v0.3.0 breaking changes:
- WsSendBatcher now uses queueMicrotask, requiring async flush in tests
- Replaced vi.mock pattern with setLiveComponentContext DI in delta tests
- Updated vite-plugin tests to reference existing components (LiveRoomChat,
  LiveForm) instead of removed LiveChat/LiveTodoList
- Skipped onRoomJoin/onRoomLeave hook tests (not invoked in v0.3.0)
- Fixed _state internal access to use public state proxy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Build errors were silently swallowed — "Server bundle failed" with no
details. Now prints the actual bun build output on failure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Running `bun add` inside plugins/crypto-auth/ during build creates a
local bun.lock that corrupts Bun's module resolution on Linux CI,
causing `Could not resolve: @fluxstack/live`. This only affects builds
after the monorepo refactor where @fluxstack/live became an npm package.

Disable autoInstall when NODE_ENV=production since `bun install` at root
already provides all needed dependencies. Also removes the committed
plugins/crypto-auth/bun.lock which should not be in the repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Two changes to fix the bundler failing with "Could not resolve:
@fluxstack/live" on Linux CI:

1. Add @fluxstack/live and @fluxstack/live-elysia to bundler externals.
   These are runtime dependencies resolved from node_modules at startup,
   not code that needs to be inlined into the bundle.

2. Remove legacy workspace.json referencing non-existent packages/
   directory. This stale workspace config may confuse Bun's module
   resolution on Linux, causing it to look for @fluxstack/live in
   workspace paths instead of node_modules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MarcosBrendonDePaula MarcosBrendonDePaula force-pushed the refactor/extract-live-to-monorepo branch from 1468db5 to e768155 Compare March 14, 2026 02:12
MarcosBrendonDePaula and others added 3 commits March 13, 2026 23:25
The published @fluxstack/live packages (v0.3.0) include a "bun" export
condition pointing to ./src/index.ts, but the npm tarball only ships
dist/. On Linux, Bun's bundler strictly follows the "bun" condition and
fails with "Could not resolve" because src/ doesn't exist.

This adds a postinstall script that strips the "bun" condition from
package exports, forcing Bun to fall back to the "import" condition
(./dist/index.js) which works correctly on all platforms.

TODO: Remove after publishing @fluxstack/live >= 0.3.1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The postinstall script (scripts/patch-live-exports.ts) must be available
when bun install runs. Both the deps and builder stages now copy the
scripts/ directory before running bun install.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The autoInstall disable (e7b47e4) was a wrong diagnosis — the real cause
was the "bun" export condition in @fluxstack/live pointing to missing
src/. Restoring autoInstall: true so plugins can install their deps
normally.

Also adds plugins/*/bun.lock to .gitignore so plugin-local lock files
don't get committed (they resolve from root node_modules).

workspace.json stays deleted — it referenced a non-existent packages/
directory and was stale.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MarcosBrendonDePaula MarcosBrendonDePaula merged commit e42ae75 into main Mar 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant